package com.l2emu.gameserver.handler.voicedcommandhandlers;

import com.l2emu.Config;
import com.l2emu.gameserver.handler.IVoicedCommandHandler;
import com.l2emu.gameserver.model.actor.instance.L2PcInstance;

/** 
 * @author Rizel
 * 
 */
public class VoteChange  implements IVoicedCommandHandler
{
	private static final String[]	VOICED_COMMANDS	=
													{ "change" };

	public boolean useVoicedCommand(String command, L2PcInstance activeChar, String target)
	{
		if (command.startsWith("change"))
		{
			if (activeChar.getVoteCount() == 0)
			{
				activeChar.sendMessage("You don't have any vote points.");
				return true;			
			}
			else
			{
				activeChar.addItem("Loot", Config.VOTE_REWARD_ITEM_ID, activeChar.getVoteCount(), activeChar, true);
				activeChar.sendMessage("You changed " + activeChar.getVoteCount() + " vote points to " + Config.VOTE_REWARD_ITEM_NAME + "!");
				activeChar.setVoteCount(0);
				return true;
			}
		}
		return false;
	}
	public String[] getVoicedCommandList()
	{
		return VOICED_COMMANDS;
	}
}